var appUrl="http://127.0.0.1:8400/";
var constH={
    appUrl:appUrl,
    pageSize:20,
    emptyListHtml:'<tr bgcolor="#FFFFFF"><td colspan="11" id="empty">没有相关记录</td></tr>'
}
var urlH={
    pmuser:{
        list:function (pageIndex) {
            return constH.appUrl + "user/getPuserList?pagesize=" + constH.pageSize + "&page=" + pageIndex;
        }
    },
    shopuser:{
        list:function (pageIndex) {
            return constH.appUrl + "user/getshopuserList?pagesize=" + constH.pageSize + "&page=" + pageIndex;
        },
        useradd:function(){
            return constH.appUrl + "user/shopuseradd";
        },
        shoplist:function(pageIndex,userid,usertype){
            return constH.appUrl + "shop/getshopList?pagesize=" + constH.pageSize + "&page=" + pageIndex+"&userid="+userid+"&usertype="+usertype;
        },
        shopdetail:function(shopid){
            return constH.appUrl +"shop/shopdetail?shopid="+shopid;
        },
        shopclassadd:function(){
            return constH.appUrl + "shop/shopclassadd";
        },
        shopclassdetail:function(scid){
            return constH.appUrl + "shop/getShopClassDetail?shopClassid="+scid;
        },
        shopadd:function(data){
            return constH.appUrl + "shop/shopadd";
        }
    },
    purchase:{
        list:function(status,source,pname,pageIndex){
            return constH.appUrl + "product/getPurchaseProductList?status="+status+"&pSource="+source+"&pname="+pname+"&pagesize=" + constH.pageSize + "&page=" + pageIndex;
        },
        changestatus:function(){
            return constH.appUrl + "product/productChangeStatus";
        },
        changeimg:function () {
            return constH.appUrl + "product/productChangeImg";
        },
        changeattr:function () {
            return constH.appUrl + "product/productChangeAttr";
        },
        changedesc:function () {
            return constH.appUrl + "product/productChangeDesc";
        },
        detail:function(){
            return constH.appUrl + "product/productdetail";
        },
        translate:function(){
            return constH.appUrl + "product/translate";
        },
        updateChdesc:function () {
            return constH.appUrl + "product/updateChdesc";
        }
    },
    orders:{
        list:function (key,pageIndex) {
            return constH.appUrl + "order/getOrderList?pagesize=" + constH.pageSize + "&page=" + pageIndex+"&key="+key;
        }
    },
    code:{
        save:function () {
            return constH.appUrl + "keywords/keyWordSave";
        },
        list:function (pageIndex) {
            return constH.appUrl + "keywords/getKeyWordsList?pagesize=" + constH.pageSize + "&page=" + pageIndex;
        },
        delete:function () {
            return constH.appUrl + "keywords/keyWordDelete";
        }
    },
    codegoods:{
        save:function () {
            return constH.appUrl + "productClass/productClassSave";
        },
        list:function (pageIndex) {
            return constH.appUrl + "productClass/getProductClassList?pagesize=" + constH.pageSize + "&page=" + pageIndex;
        }
    },
    codeamazon:{
        save:function () {
            return constH.appUrl + "browsetree/chPathSave";
        },
        list:function (pageIndex ,search) {
            return constH.appUrl + "browsetree/getBrowseTreeList?pagesize=" + constH.pageSize + "&page=" + pageIndex+"&search="+search;
        },
        detail:function (enid) {
            return constH.appUrl + "browsetree/getAmazonInfoByEnid?enid="+enid;
        }
    },
    publish:{
        list:function(shopid,sku,title,pageIndex){
            return constH.appUrl + "product/getPublishList?shopid="+shopid+"&sku="+sku+"&title="+title+"&pagesize=" + constH.pageSize + "&page=" + pageIndex;
        }
    }
};

function fmtDate(inputTime){
    var date = new Date(inputTime);
    var y = date.getFullYear();
    var m = date.getMonth() + 1;
    m = m < 10 ? ('0' + m) : m;
    var d = date.getDate();
    d = d < 10 ? ('0' + d) : d;
    var h = date.getHours();
    h = h < 10 ? ('0' + h) : h;
    var minute = date.getMinutes();
    var second = date.getSeconds();
    minute = minute < 10 ? ('0' + minute) : minute;
    second = second < 10 ? ('0' + second) : second;
    return y + '-' + m + '-' + d+' '+h+':'+minute+':'+second;
}

